REM *************************  EFA1M ************************
REM This is the Script file of EFA1M
REM Project: SL203
REM Release Date: 2011/09/28
REM Author: WeiLee
REM v0.0010: Init Version.
REM *******************************************************


5 SYSTEM KeyEventDisable()
6 FOREIGN PowerSaving(0)
REM 5 LET KEY_OK  = 11
REM 6 SYSTEM delay_us(100000)
REM 7 SYSTEM Ret = KeyStateGet(KEY_OK)
REM 8 IF Ret == 0 THEN 6 ELSE 9
REM 9 FOREIGN ClearOSD()

10 LET MaxDiff = 0
20 LET Offset4StartStep = 0
30 LET JumpSteps = 0
40 LET SampleNum = 0
50 LET LogContractValue = 1
51 LET RET = 1
60 LET K = 1
61 FOREIGN RET = LensCali_BackDoor(600,K)

70 LET RetEFA = 1
80 Zoom(32)
85 SYSTEM KeyEventDisable()


90 LET KEY_OK  = 11
95 LET message = " Press OK to Continue"
100 SYSTEM ScreenString(50,50,message)
105 SYSTEM delay_us(100000)
110 SYSTEM Ret = KeyStateGet(KEY_OK)
115 IF Ret == 0 THEN 90 ELSE 140
140 FOREIGN RetEFA = LensCali_EFA(MaxDiff,Offset4StartStep,JumpSteps,SampleNum,LogContractValue)
150 IF RetEFA == 0 THEN 300 ELSE 250

REM *****Zoom Fail case*****
200 LET lcdprint = "Zoom NG ErrCode: " + Ret
210 FOREIGN RetEFA = OneCard_FlgSet(0)
REM 215 FOREIGN Ret = OneCard_ErrPrint(lcdprint)
216 FOREIGN KeyReview(0)
220 FOREIGN OneCard_ErrCodePrint(Ret)
230 GOTO 10000

REM *****EFA Fail case*****
250 LET lcdprint = "EFA NG ErrCode: " + RetEFA
260 FOREIGN Ret = OneCard_FlgSet(0)
REM 265 FOREIGN Ret = OneCard_ErrPrint(lcdprint)
266 FOREIGN KeyReview(0)
270 FOREIGN OneCard_ErrCodePrint(RetEFA)
280 GOTO 10000

REM *****Pass case*****
300 FOREIGN Ret = OneCard_FlgSet(1)
310 FOREIGN OneCardTest(1)
REM 320 END

10000 SYSTEM KeyEventEnable()

11000 END

RUN
